package com.activemq.producer.impl;

import com.activemq.producer.IMessageProducerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Service;

import javax.jms.Queue;
import javax.jms.Topic;

/**
 * @Author: 胡成
 * @Version: 0.0.1V
 * @Date: 2018/10/24
 * @Description: 发送消息实现类
 **/
@Service("messageProducerQueueService")
public class MessageProducerQueueServiceImpl implements IMessageProducerService{

    @Autowired
    private JmsMessagingTemplate messagingTemplate;

    @Override
    public void sendMessageQueue(String msg,Queue queue) {
        messagingTemplate.convertAndSend(queue,msg);
    }

    @Override
    public void sendMessage(String msg, Topic topic) {

    }
}
